<template>
  <div id="app">
    <lds-button @click="fn">登录</lds-button>
    <lds-button type="text" disabled>注册</lds-button>
    <lds-button type="primary" loading>加载中</lds-button>
    <!-- <lds-upload
      ref="upload"
      list-type="picture-card"
      multiple
      :limit="3"
      :auto-upload="false"
      :beforeUpload="beforeUpload"
      :on-exceed="handleExceed"
      :on-preview="handlePictureCardPreview"
      :on-remove="handleRemove">
      <i class="lds-icon-plus"></i>
    </lds-upload> -->
    <lds-upload
  class="upload-demo"
  action="#"
  :on-preview="handlePreview"
  :on-remove="handleRemove"
  :before-remove="beforeRemove"
  multiple
  :limit="3"
  :on-exceed="handleExceed"
  :file-list="fileList">
      <lds-button size="small" type="primary">点击上传</lds-button>
      <div slot="tip" class="lds-upload__tip">
        只能上传jpg/png文件，且不超过500kb
      </div>
    </lds-upload>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      fileList:[]
    };
  },
  methods: {
    fn(e) {
      console.log(e)
    },
    handleRemove(file) {
      console.log('删除' + file);
    },
    handlePictureCardPreview(file) {
      console.log('查看大图' + file)
    },
    handleDownload(file) {
      console.log('下载' + file);
    },
    handleExceed() {
      alert(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
    },
    beforeUpload() {
      console.log("上传前")
    },
    handlePreview(file) {
      console.log(file);
    },
    beforeRemove(file, fileList) {
      return confirm(`确定移除 ${file.name}？`);
    }
  }
}
</script>
